package com.trkj.controller.lzs;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.trkj.pojo.ProjectTemplate;
import com.trkj.pojo.Salary;
import com.trkj.pojo.SocialLeixing;
import com.trkj.service.lzs.SocialLeixingService;
import com.trkj.vo.Result2;

@Controller
public class SocialLeixingController {
	//查询所有
	   @Autowired
	   private  SocialLeixingService SocialLeixingService;
	
		@RequestMapping("findAllSocialLeixing")
		@ResponseBody
		public List<SocialLeixing> SocialLeixingfall(){
			List<SocialLeixing> list = SocialLeixingService.SocialLeixingfall();
			return list;
		}
		
		
		//添加
		@RequestMapping("lzs_SocialLeixingadd")
		@ResponseBody
		public void SocialLeixingtj(Timestamp sblxDate,String sblxName, String sblxPerson,Timestamp sblxUpdate, BigDecimal sblxZt ){
			System.out.println("进来");
			SocialLeixingService.SocialLeixingadd(sblxDate, sblxName, sblxPerson, sblxUpdate, sblxZt);
		}
		/*修改
		*/
		@RequestMapping("lzs_SocialLeixingxiugai")
		@ResponseBody  
		public  Result2  SocialLeixingxiugai(long sblxId, Timestamp sblxDate,String sblxName, String sblxPerson,Timestamp sblxUpdate, BigDecimal sblxZt ,Timestamp templateCreatordate,String templateName,String templatePerson, BigDecimal varsionNumber) {
			try {
				SocialLeixingService.lzs_SocialLeixingbj(sblxId, sblxDate, sblxName, sblxPerson, sblxUpdate, sblxZt);
				return Result2.SUCCESS;
			} catch (Exception e) {
					e.printStackTrace();
				return Result2.failure(e.getMessage());
			}
			
		}
		@RequestMapping("lzs_SocialLeixingew")
		@ResponseBody  
		 public SocialLeixing chunq(Long sblxId) {
	    	 return SocialLeixingService.chun1(sblxId);
	     }
		
		
		//模糊查询shuoy
				@RequestMapping("lzs_SocialLeixingechaxun")
				@ResponseBody
				public  List<SocialLeixing> Query(String text){
					System.out.println(text);
					return (List<SocialLeixing>) SocialLeixingService.queryByName(text);
				}
				//删除；通过id查出相应的一条数据
				@RequestMapping("hr_ra_form_SocialLeixing")
				@ResponseBody
				public boolean hr_ra_form_SocialLeixing(Long sblxId){
					 return SocialLeixingService.dltRay(sblxId);
				}
}
